package com.his.his_system.domain;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;

public class LoginUser implements UserDetails{

    private DzmHisMember dzmHisMember;

    public DzmHisMember getDzmHisMember() {
        return dzmHisMember;
    }

    public void setDzmHisMember(DzmHisMember dzmHisMember) {
        this.dzmHisMember = dzmHisMember;
    }

    public LoginUser(DzmHisMember dzmHisMember){
        this.dzmHisMember = dzmHisMember;
    }

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public String getPassword() {
        return dzmHisMember.getPassword();
    }

    @Override
    public String getUsername() {
        return dzmHisMember.getUsername();
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }
}
